#include<stdio.h>
int main()
{
	int hour,minute;
	float T,t;
	scanf("%d %d",&hour,&minute);
	t=hour+minute*0.1/60*10;
	T=4*t*t/(t+2)-20;
	printf("%.2f",T);
	return 0;
}
